#!/bin/sh
#
# Author ： hbaolong@vip.qq.com
#
# Function : 从字典库中随机抽出5个单词
#
#
#

if [ $# -gt 1 ]; then
	echo "Usage: $0 "
	exit
fi

workdir="/Users/hbaolong/workshop/gitee/3place/dicts/"
cd $workdir

if [ $# -eq 1 ]; then
	dictfile=$1"*"
else
	dictfile="bdc.md"
fi

allwords=`wc $workdir$dictfile | awk '{print $1}'`

for counter in {1..1}

do

	rannum=`echo $((RANDOM % $allwords + 1))`

	line=`echo $rannum"p"`

	ce `sed -n $line $workdir$dictfile`

done
